home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / tools / amiga / 3d_tools / font4d.lha / Font-4D-Demo / PencilVC's / pencil.pov < prev    next >
Encoding:
Text File  |  1994-03-14  |  6.8 KB  |  260 lines

  1. // Persistence Of Vision Raytracer version 2.0 sample file.
  2.  
  3. // By Jorge Arreguin
  4. /*
  5.   NOTE: Requires PENCIL_.GIF (320x200x256)
  6.   This scene file makes a pencil along y axis 
  7.   with the label "Persistence Of Vision"
  8.  
  9.   By:  Jorge Arreguin
  10.  
  11.   Translation to English and dkb version 2.10 by Aaron a. Collins with a bit
  12.   of help from David on the imagemap registration.
  13.  
  14.   note - unless this is rendered at a minimum of 640 x whatever, the logo
  15.          is quite unreadable.
  16.  
  17.   The Pencil - major export of Faber, Pennsylvania, due to the plentiful
  18.   presence of pencilwood trees and eraser-root plants, and the nearby
  19.   graphite mines.
  20.                                                 (John Landis - Animal House)
  21. */
  22.  
  23. #include "shapes.inc"
  24. #include "colors.inc"
  25. #include "textures.inc"
  26.  
  27. #declare PencilPaint = pigment { color red 1.0 green 0.6666 blue 0.33333 }
  28.  
  29. union {
  30.    /*----------------------------- parte metalica ----------------------*/
  31.    /*                             (that metal part)                     */
  32.    union {
  33.       union {
  34.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate 2.0*z }
  35.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate 1.0*z }
  36.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > }
  37.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate -1.0*z }
  38.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate -2.0*z }
  39.  
  40.          translate 38.5*z
  41.  
  42.          texture {
  43.             pigment { Gold }
  44.             finish { reflection 0.3 }
  45.          }
  46.       }
  47.  
  48.       union {
  49.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate 2.0*z }
  50.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate 1.0*z }
  51.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > }
  52.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate -1.0*z }
  53.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate -2.0*z }
  54.  
  55.          translate 30.5*z
  56.  
  57.          texture {
  58.             pigment { Gold }
  59.             finish { reflection 0.3 }
  60.          }
  61.       }
  62.  
  63.       object {
  64.          Disk_Z
  65.          scale < 3.5, 3.5, 3.0 >
  66.          translate 34.0*z
  67.          texture {
  68.             pigment { Brown }
  69.             finish { reflection 0.25 }
  70.          }
  71.       }
  72.  
  73.       bounded_by { sphere { <0.0, 0.0, 34.0>, 9.0 } }
  74.    }
  75.  
  76.    /*---------------------------------- borrador ----------------------------*/
  77.    /*                (the rubber eraser, from eraser-root plants)            */
  78.  
  79.    union {
  80.       object {
  81.          Disk_Z
  82.          scale < 3.5, 3.5, 3.0 >
  83.          translate 41.0*z
  84.          texture {
  85.             pigment { Pink }
  86.          }
  87.       }
  88.       sphere {
  89.          < 0.0, 0.0, 44.0 >, 3.5
  90.          texture { pigment { Pink } }
  91.       }
  92.    }
  93.  
  94.    /*---------------------------------- cuerpo de madera ---------------------*/
  95.    /*                                 (body of pencilwood)                    */
  96.    difference {
  97.       intersection {
  98.          plane {
  99.             y, 3.031
  100.             texture { pigment { PencilPaint } }
  101.             texture {
  102.                pigment {
  103.                   image_map {
  104.                      gif "pencil_.gif" filter 0 1.0  /* colour 0 is the "key" or transparent colour */
  105.                      once
  106.                   }
  107.                   rotate <0, -90, -90>
  108.                   scale <15.0 ,1.0, 15.0>
  109.                   translate <-12.2, 0.0, 12.0 >
  110.                }
  111.             }
  112.  
  113.                /* Now for the complicated image mapping:
  114.   Currently, the pencil is standing up in the z axis:
  115.                    z
  116.  
  117.              eraser  ^ *vp
  118.                      | |   
  119.                      | |
  120.                      | |----/ y
  121.                      |     /
  122.                      |    /
  123.                      |   /
  124.                      |  /
  125.                      | /
  126.              point   |/
  127.                      -------------->
  128.                                    x
  129.  
  130.   We want the image to be mapped as follows (viewed from the +ve y axis):
  131.  
  132.           Right
  133.           ---- z=28.0
  134.           |  |
  135.           |..|
  136.           |..|
  137.           |..|
  138.           |ee|
  139.           |ce|
  140.       Top |ar| Bottom
  141.           |rf|
  142.           |t |
  143.           | s|
  144.           |b'|
  145.           |Kt|
  146.           |di|
  147.           ---- z=12.7
  148.           Left
  149.  
  150.           ^  ^
  151.           |  |
  152.     x=1.75   x=-1.75
  153.  
  154.  The image map above gives (viewed from the y axis):
  155.  
  156.                    ^ z
  157.           1,1 Right|
  158.              ------|
  159.              |     |
  160.              |     |
  161.          Top |     |Bottom
  162.              |     |
  163.              |     |
  164.          <----------
  165.           x   Left     
  166.  
  167.   Which is at least in the right orientation.
  168.  
  169.   Now, we must scale the image so the letters are the right size. */
  170.  
  171.                //         scale <15.0 1.0 15.0>  /* Never use 0 for any scale value */
  172.  
  173.                /* Now, we align the top left of the picture to the proper point on the
  174.   pencil.  This is a bit tricky because the top left of the picture is now
  175.   at x=15 z=0.  We have to move it to about x=-12, z=12 because the letters
  176.   don't start at the very top of the image. */
  177.  
  178.                //         translate <-12.20 0 12>
  179.  
  180.                /* As you may have guessed, this still took a lot of trial and error to get it
  181.   right, but some analysis of the picture before hand saved a lot of time. */
  182.                //      }
  183.  
  184.          }
  185.          plane {
  186.             y, 3.031
  187.             rotate 60.0*z
  188.             pigment { PencilPaint }
  189.          }
  190.          plane {
  191.             y, 3.031
  192.             rotate 120.0*z
  193.             pigment { PencilPaint }
  194.          }
  195.          plane {
  196.             y, 3.031
  197.             rotate 180.0*z
  198.             pigment { PencilPaint }
  199.          }
  200.          plane {
  201.             y, 3.031
  202.             rotate 240.0*z
  203.             pigment { PencilPaint }
  204.          }
  205.          plane {
  206.             y, 3.031
  207.             rotate 300.0*z
  208.             pigment { PencilPaint }
  209.          }
  210.          plane { z, 28.0 }
  211.          plane { z, 3.629 inverse }
  212.       }
  213.       object { QCone_Z inverse scale < 0.275558, 0.275558, 1.0 > }
  214.  
  215.       texture {
  216.          pigment {
  217.             Pine_Wood
  218.             turbulence 0.1
  219.             scale 1.5
  220.             rotate 90.0*y
  221.             translate 30.0*x
  222.          }
  223.       }
  224.    }
  225.  
  226.    /*---------------------------- punta de grafito ------------------------------*/
  227.    /*                            (point of graphite)                             */
  228.  
  229.    intersection {
  230.       object { QCone_Z scale < 0.275558, 0.275558, 1.0 > }
  231.       plane { z, 3.629 }
  232.       plane { z, 0.001 inverse }
  233.  
  234.       texture {
  235.          pigment { Black }
  236.          finish {
  237.             reflection 0.25
  238.             phong 1.0
  239.             phong_size 20
  240.          }
  241.       }
  242.    }
  243.  
  244.    rotate 90.0*x
  245.    translate < 0.0, 22.0, 3.5 >
  246.    
  247. }
  248.  
  249. /*-------------------------- plano de horizonte --------------------------*/
  250. /*                           (plane of horizon)                           */
  251.  
  252. plane {
  253.    z, 0.0
  254.  
  255.    texture {
  256.       pigment { Green }
  257.       finish { reflection 0.25 }
  258.    }
  259. }
  260.